﻿Imports System.ServiceModel
<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerCall)> _
Public Class BCSchool
    Implements IBCSchool



    Public Sub RegisterStudent(ByVal item As BusinessEntities.Alumno) Implements IBCSchool.RegisterStudent
        Try
            Dim rep As IAlumnosRepositorio = New AlumnosRepositorio()
            rep.Add(item)
        Catch ex As Exception
            Throw New FaultException(ex.Message)
        End Try
    End Sub

    Public Function SearchAlumno(ByVal Id As System.Guid) As BusinessEntities.Alumno Implements IBCSchool.SearchAlumno
        Dim result As BusinessEntities.Alumno
        Try
            Dim rep As IAlumnosRepositorio = New AlumnosRepositorio()
            result = rep.GetOne(Id)
        Catch ex As Exception
            Throw New FaultException(ex.Message)
        End Try
        Return result
    End Function

    Public Function SearchAlumnos() As System.Collections.Generic.List(Of BusinessEntities.Alumno) Implements IBCSchool.SearchAlumnos
        Dim result As List(Of BusinessEntities.Alumno)
        Try
            Dim rep As IAlumnosRepositorio = New AlumnosRepositorio()
            result = rep.GetAll()
        Catch ex As Exception
            Throw New FaultException(ex.Message)
        End Try
        Return result
    End Function
End Class
